package initialize

import (
	"ChdChat-Gin/config"
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
	"log"
)

var Conn *gorm.DB

func init() {
	var err error
	if Conn, err = gorm.Open(mysql.Open(config.MYSQLPATH),
		&gorm.Config{}); err != nil {
		panic(err)
	} else {
		log.Println("Connect mysql successfully")
	}
}
